###readme.txt

This folder contains the all Tables and Figures in original analysis included
in Chapter 8 of:
    Enos, Ryan D. 2017. The Space Between Us:
        Social Geography and Politics

Updated: May 16, 2018

***To replicate these files*** run "Chapter8Master.r" by typing
"source('Chapter8Master.r')" into the R terminal. This will use
pre-processed data to output tables and figures in the book and appendix.
It does so by calling the subordinate files: "TablesA31A32Figure8_6.r" and
"TableA33.r".

**Prior to executing the scripts, the R terminal should be pointed to the
directory in which the replication files are located, which can be accomplished
by typing "setwd('..')" where ".." is the local file structure where the replication
files are located.

These files require the R programming language, which can be downloaded here: http://www.r-project.org/

You execute replication_master.r, you may need to install the packages
used, this can be accomplished by typing the following in the R terminal:
install.packages('apsrtable'); install.packages('Zelig');
install.packages('ggplot2'); install.packages('spdep');
install.packages('xtable'); install.packages('car'); install.packages('lmtest')




Questions? Please contact Ryan Enos (renos@gov.harvard.edu).

************************************************************** ***

There are three .csv files associated with each of these scripts. Descriptions
of the csv and variables included are below:

***TableA31_data.csv.csv***

creates output for Table A31 in the Appendix.

This is the shape file for precincts in the June 2008 primary election.

Variables:

"Cnsld": name of the precinct

"pct_obama": percent Obama vote.


***TableA32Figure8_6_data.csv***

creates output for Tables A32 in the Appendix and Figure 8.6 in the book.

Variables:

"pct_obama": percent Obama vote in June 2008.

"log_distance": log of distance, in feet, of precinct to a heavily Black
precinct

"log_median_income": log of median income, in dollars, of precinct,
interpolated from the 2000 Census

"pct_hisp_immigrant": percent Hispanic immigrant in the precinct,
interpolated from the 2000 Census

"pct_college": percent college graduate in the precinct, interpolated from
the 2000 Census

"total_ballots_cast": total ballots cast in the June 2008 election



***TableA33_data.csv***

creates output for Tables A33 in the Appendix.

Variables:

"junevote": did the voter vote in the June 2008 election (0/1)?

"difftreat": was the voter treated by being compared to a block primarily of
a different race (o/1)?

"sametreat": was the voter treated by being compared to a block primarily
of the same race (o/1)?

"turndiff": the difference in turnout between the comparison block and the
voter's block as displayed on the letters.

"distance": distance, in kilometers, between the comparison block and
voter's block

"compare.block.herf": herfindahl index of comparison block based on
imputation of race from names and geography on the voter file

"vote.history": number of times the voter voted in the previous 8 elections
before June 2008

"cityblock": the name of the city block on which the voter lived, hashed for
purposes of subject anonymity.

"dem": is the voter a Democrat (0/1)?

"rep": is the voter a Republican (0/1)?

"age": voter's age in years

"black": is the voter Black (0/1)?
